package com.dogkr.server.web.guest;

import java.util.List;

import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Namespace;
import org.apache.struts2.convention.annotation.ParentPackage;
import org.apache.struts2.convention.annotation.ResultPath;
import org.apache.struts2.convention.annotation.Results;
import org.springframework.beans.factory.annotation.Autowired;

import com.dogkr.common.ServerAction;
import com.dogkr.server.entity.District;
import com.dogkr.server.entity.DistrictArea;
import com.dogkr.server.service.DistrictService;


// 设置Struts2注解
@ParentPackage(value = "project-default")
@Namespace(value = "/district")
@ResultPath("/WEB-INF/jsps")
// 页面文件空间
@Results({
})
public class DistrictAction extends ServerAction {
	
	private static final long serialVersionUID = 1L;
	
	@Autowired
	private DistrictService districtService;
	
	@Action(value="get")
	public void get() {
		List<District> data = districtService.selectDistrictByLoaclId(id);
		outJson(data);
	}
	
	@Action(value="getarea")
	public void getArea() {
		List<DistrictArea> data = districtService.selectDistrictAreaByDisId(id);
		outJson(data);
	}
}
